package com.zc.designmodel.behavioral.interpreter;

/**
 * @author: zhuCan
 * @date: 2020/4/15 16:42
 * @description:
 */
public class AndExpression implements Expression {

  private Expression expression;
  private Expression andExpression;

  public AndExpression(Expression expression, Expression andExpression) {
    this.andExpression = andExpression;
    this.expression = expression;
  }

  @Override
  public boolean interpret(String context) {
    return expression.interpret(context) && andExpression.interpret(context);
  }
}
